const program = require('commander')
const figlet = require('figlet')
const chalk = require('chalk')
const package = require('../package.json')
figlet('auto-vue-generator', async (err, data) => {
  console.log(chalk.yellow(data))
  require('./checkVersion')
  require('./info')
  program
    .version(package.version, '-v, --version')
    .usage('<command> [options]')
    .command('create <name>')
    .description('创建vue组件')
    .alias('c')
    .action(name => {
      require('./generator').init(name)
    })

  program.parse(process.argv)
  if (!program.args.length) {
    program.help()
  }
})
